package com.ieasy.module.site.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import com.ieasy.basic.dao.ExtFieldEntity;

@Entity
@Table(name = "ieasy_site_column")
public class ColumnEntity extends ExtFieldEntity {
	
	//栏目名称
	private String colName;
	
	//栏目别名
	private String colAlias ;

	//栏目类型
	private String colType;

	//栏目URL
	private String colUrl ;
	
	//栏目级别
	private String colLevel ;
	
	//栏目状态（-1不显示，1显示）
	private Integer colStatus ;
	
	//栏目描述
	private String colDesc ;
	
	//栏目LOGO图片地址
	private String colLogo ;
	
	//生产静态文件（-1不生成，1生成）
	private String colStatic ;
	
	//静态文件的所在目录
	private String colFolder ;
	
	//栏目是否加热
	private String colHot ;
	
	//是否显示(0不发布，1发布)
	private int isShow ;
	
	private Integer sort = new Integer(1) ;
	
	private ColumnEntity col;

	private Set<ColumnEntity> cols = new HashSet<ColumnEntity>(0);

	private Set<DocEntity> pages = new HashSet<DocEntity>(0);
	
	
	private String type ;

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	@OneToMany(mappedBy = "col", fetch = FetchType.LAZY)
	@OrderBy("sort asc")
	public Set<DocEntity> getPages() {
		return pages;
	}

	public int getIsShow() {
		return isShow;
	}

	public void setIsShow(int isShow) {
		this.isShow = isShow;
	}

	public void setPages(Set<DocEntity> pages) {
		this.pages = pages;
	}

	public String getColAlias() {
		return colAlias;
	}

	public void setColAlias(String colAlias) {
		this.colAlias = colAlias;
	}

	public String getColUrl() {
		return colUrl;
	}

	public void setColUrl(String colUrl) {
		this.colUrl = colUrl;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public String getColLevel() {
		return colLevel;
	}

	public void setColLevel(String colLevel) {
		this.colLevel = colLevel;
	}

	public Integer getColStatus() {
		return colStatus;
	}

	public void setColStatus(Integer colStatus) {
		this.colStatus = colStatus;
	}

	public String getColDesc() {
		return colDesc;
	}

	public void setColDesc(String colDesc) {
		this.colDesc = colDesc;
	}

	public String getColLogo() {
		return colLogo;
	}

	public void setColLogo(String colLogo) {
		this.colLogo = colLogo;
	}

	public String getColStatic() {
		return colStatic;
	}

	public void setColStatic(String colStatic) {
		this.colStatic = colStatic;
	}

	public String getColFolder() {
		return colFolder;
	}

	public void setColFolder(String colFolder) {
		this.colFolder = colFolder;
	}

	public String getColHot() {
		return colHot;
	}

	public void setColHot(String colHot) {
		this.colHot = colHot;
	}

	public String getColName() {
		return colName;
	}

	public void setColName(String colName) {
		this.colName = colName;
	}

	public String getColType() {
		return colType;
	}

	public void setColType(String colType) {
		this.colType = colType;
	}

	@ManyToOne
	@JoinColumn(name = "pid")
	public ColumnEntity getCol() {
		return col;
	}

	public void setCol(ColumnEntity col) {
		this.col = col;
	}

	@OneToMany(mappedBy = "col", fetch = FetchType.LAZY)
	@OrderBy("sort asc")
	public Set<ColumnEntity> getCols() {
		return cols;
	}

	public void setCols(Set<ColumnEntity> cols) {
		this.cols = cols;
	}

}
